<template>
  <div class="fbqk">
    <div class="head">
      <span>分班情况查询</span>
      <!-- <button>
        <a
          :href="'http://118.31.51.131:8081/api/zsxt/lqgl/dc?token=' + token"
          download="各省各类计划录取状态.csv"
          >导出</a
        >
      </button>
      <button>退出</button> -->
    </div>

    <el-table :data="tableData" height="720" border style="width: 100%">
      <el-table-column type="index" label="序号" width="200"></el-table-column>
      <el-table-column prop="zydh" label="专业代号" width="280">
      </el-table-column>
      <el-table-column prop="bjdh" label="班级代号" width="240">
      </el-table-column>
      <el-table-column prop="bjmc" label="班级名称" width="240">
      </el-table-column>
      <el-table-column prop="bjrs" label="班级人数"> </el-table-column>
      <el-table-column prop="nsrs" label="男生人数" width="200">
      </el-table-column
      ><el-table-column prop="vsrs" label="女生人数" width="200">
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { request } from '../../network/request'
export default {
  name: "",
  data() {
    return {
      tableData: [],
      token: sessionStorage.getItem("token"),
    };
  },
  methods: {},
  beforeCreate() {
    if (sessionStorage.getItem("token") == null) {
      this.$router.push("/login");
    } else {
      let token = sessionStorage.getItem("token");
      let length = sessionStorage.getItem("token").length;
      if (token[length - 3] == "0") {
        this.$router.replace("/login");
      }
    }
  },
  created() {
    request({
      url: 'http://118.31.51.131:8081//api/zsxt/fbgl/ckFbqk',
      method: 'post',
      params: {
        token: sessionStorage.getItem('token')
      }
    }).then(value => {
      console.log(value);
      this.tableData = value.data
    })
  },
  components: {},
};
</script>

<style scoped>
.head {
  height: 80px;
  border-bottom: 1px solid black;
}
.head span {
  font-size: 20px;
  line-height: 80px;
  margin-left: 25px;
}
/* .head button:nth-of-type(1) {
  margin-left: 1000px;
}
.head button:nth-of-type(2) {
  margin-left: 100px;
}
a {
  display: inline-block;
  width: 100px;
  height: 50px;
  line-height: 50px;
  text-decoration: none;
  color: #fff;
}
button {
  width: 100px;
  height: 50px;
  border: none;
  outline: none;
  cursor: pointer;
  color: #fff;
  background-color: rgb(192, 51, 56);
}
button:active {
  opacity: 0.8;
} */
.fbqk ::v-deep .el-table .cell {
  text-align: center;
}
</style>